package com.general.app.wjgl.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.general.app.wjgl.dao.IQuestionDao;
import com.general.app.wjgl.dao.entity.Question;
import com.general.app.wjgl.service.IQuestionService;
import com.general.common.service.impl.BaseServiceImpl;
import com.general.utils.base.StringUtil;



/**
 * 问卷试题
 * @author Administrator
 *
 */
public class QuestionServiceImpl extends BaseServiceImpl<Question, IQuestionDao> implements
		IQuestionService {

	
	/*
	 * (non-Javadoc)
	 * @see com.general.app.wjgl.service.IQuestionService#getQuestionListByIds(java.lang.String)
	 */
	public List<Question> getQuestionListByIds(String ids) {

		if (StringUtil.isEmpty(ids)){
			throw new NullPointerException();
		}
		
		String[] id = ids.split(",");
		List<String> list = new ArrayList<String>(Arrays.asList(id));
		
		return dao.getQuestionListByIds(list);
	}

	
	/*
	 * (non-Javadoc)
	 * @see com.general.app.wjgl.service.IQuestionService#getSurveyQuestionList(java.lang.String)
	 */
	public List<Question> getSurveyQuestionList(String surveyId) {
		return dao.getSurveyQuestionList(surveyId);
	}

	/**
	 * 查询试题回答信息
	 * @param map
	 * @return
	 */
	public List<Question> getSurveyQuestionAnswerList(Map<String,String> map){
		return dao.getSurveyQuestionAnswerList(map);
	}
	

}
